#include <bits/stdc++.h>
using namespace std;
using ll=long long;
ll n,mysum;
int main()
{
  ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  cin>>n;
  vector<ll> arr(n);
  for(int i=1;i<=n;++i)
  {
    cin>>arr[i];
  }
  sort(arr.begin()+1,arr.begin()+1+n,greater<ll>());
  if(n%2==0)
  {
    for(int i=1;i<=n;++i)
    {
      if(arr[i]<=0) break;
      mysum+=arr[i];
    }
  }
  else if(n%2!=0)
  {
    for(int i=1;i<=n-1;++i)
    {
      if(arr[i]<=0) break;
      mysum+=arr[i];
    }
  }
  cout<<mysum;
  return 0;
}
